	
	package servlet.title;
	
	import java.io.IOException;
	import javax.servlet.ServletException;
	import javax.servlet.http.HttpServlet;
	import javax.servlet.http.HttpServletRequest;
	import javax.servlet.http.HttpServletResponse;
	import enitys.Title;
	import service.TitleManager;
	
	public class ShowModify extends HttpServlet {
	
		/**
		 * 
		 */
		private static final long serialVersionUID = 1L;

		/**
		 * Constructor of the object.
		 */
		public ShowModify() {
			super();
		}
	
		/**
		 * Destruction of the servlet. <br>
		 */
		public void destroy() {
			super.destroy(); // Just puts "destroy" string in log
			// Put your code here
		}
	

		/**
		 * 用于跳转到显示修改通知页面的Servlet
		 *
		 */
		public void doGet(HttpServletRequest request, HttpServletResponse response)
				throws ServletException, IOException {
			//获取要修改的通知的ID
			int id = Integer.parseInt(request.getParameter("modifyId"));
			//获取业务对象  调用相应方法
			TitleManager manager = TitleManager.getInstance();
			Title info = manager.findTitleById(id);
			//向request设置结果Bean  并跳转页面
			request.setAttribute("title",info);
			this.getServletConfig().getServletContext().getRequestDispatcher("/jsp/title/UpdateTitle.jsp").forward(request, response);
			
		}
	

		public void doPost(HttpServletRequest request, HttpServletResponse response)
				throws ServletException, IOException {
	
				doGet(request,response);
		}
	
		/**
		 * Initialization of the servlet. <br>
		 *
		 * @throws ServletException if an error occurs
		 */
		public void init() throws ServletException {
			// Put your code here
		}
	
	}
